<!-- HTML header for doxygen 1.8.3.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>Sifteo SDK: Sifteo::BG2Drawable Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-style-overrides.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<center>
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Sifteo SDK" src="sdk_logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">
   &#160;<span id="projectnumber">v1.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
</center>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Home</span></a></li>
      <li><a href="pages.html"><span>Guides</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Reference</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>Sifteo</b></li><li class="navelem"><a class="el" href="struct_sifteo_1_1_b_g2_drawable.html">BG2Drawable</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="struct_sifteo_1_1_b_g2_drawable-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Sifteo::BG2Drawable Struct Reference<div class="ingroups"><a class="el" href="group__video.html">Video</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>A VRAM accessor for drawing graphics in the BG2 mode.  
 <a href="struct_sifteo_1_1_b_g2_drawable.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="bg2_8h_source.html">sifteo/video/bg2.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a42018e930ac090e1ebb2b505844055c3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a42018e930ac090e1ebb2b505844055c3"></a>
<a class="el" href="struct_sifteo_1_1_cube_i_d.html">CubeID</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_b_g2_drawable.html#a42018e930ac090e1ebb2b505844055c3">cube</a> () const </td></tr>
<tr class="memdesc:a42018e930ac090e1ebb2b505844055c3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the <a class="el" href="struct_sifteo_1_1_cube_i_d.html" title="A lightweight identifier for one Sifteo cube.">CubeID</a> associated with this drawable. <br/></td></tr>
<tr class="separator:a42018e930ac090e1ebb2b505844055c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac3f2bafb7d3461525daec13349a6808d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_b_g2_drawable.html#ac3f2bafb7d3461525daec13349a6808d">erase</a> (uint16_t index=0)</td></tr>
<tr class="memdesc:ac3f2bafb7d3461525daec13349a6808d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Erase mode-specific VRAM, filling the BG2 buffer with the specified absolute tile index value.  <a href="#ac3f2bafb7d3461525daec13349a6808d">More...</a><br/></td></tr>
<tr class="separator:ac3f2bafb7d3461525daec13349a6808d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab5494d922c1e1d276dd66dfac6751be3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab5494d922c1e1d276dd66dfac6751be3"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_b_g2_drawable.html#ab5494d922c1e1d276dd66dfac6751be3">erase</a> (const <a class="el" href="struct_sifteo_1_1_pinned_asset_image.html">PinnedAssetImage</a> &amp;<a class="el" href="struct_sifteo_1_1_b_g2_drawable.html#a8e9f1e5922e81e596d3ac3521af12e4b">image</a>)</td></tr>
<tr class="memdesc:ab5494d922c1e1d276dd66dfac6751be3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Erase mode-specific VRAM, filling the BG2 buffer with the first tile from the specified <a class="el" href="struct_sifteo_1_1_pinned_asset_image.html" title="An AssetImage in which all tiles are stored sequentially in memory.">PinnedAssetImage</a>. <br/></td></tr>
<tr class="separator:ab5494d922c1e1d276dd66dfac6751be3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8b5b5f6933bf76a1d93dd7f4ac2c2cee"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_b_g2_drawable.html#a8b5b5f6933bf76a1d93dd7f4ac2c2cee">fill</a> (<a class="el" href="group__math.html#ga2e4fcb4037bc16967e23c20126d25396">UInt2</a> topLeft, <a class="el" href="group__math.html#ga2e4fcb4037bc16967e23c20126d25396">UInt2</a> size, unsigned tileIndex)</td></tr>
<tr class="memdesc:a8b5b5f6933bf76a1d93dd7f4ac2c2cee"><td class="mdescLeft">&#160;</td><td class="mdescRight">Fill a rectangle of identical tiles, specified as a top-left corner location and a size.  <a href="#a8b5b5f6933bf76a1d93dd7f4ac2c2cee">More...</a><br/></td></tr>
<tr class="separator:a8b5b5f6933bf76a1d93dd7f4ac2c2cee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3247ef14b9ea7b639eed545a6030593f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3247ef14b9ea7b639eed545a6030593f"></a>
<a class="el" href="struct_sifteo_1_1_r_g_b565.html">RGB565</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_b_g2_drawable.html#a3247ef14b9ea7b639eed545a6030593f">getBorder</a> () const </td></tr>
<tr class="memdesc:a3247ef14b9ea7b639eed545a6030593f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the last border color set by <a class="el" href="struct_sifteo_1_1_b_g2_drawable.html#ad1141ac18e19f20e1a1f54eef1bf0153" title="Set the border color, given an arbitrary 16-bit RGB565 color.">setBorder()</a>. <br/></td></tr>
<tr class="separator:a3247ef14b9ea7b639eed545a6030593f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8e9f1e5922e81e596d3ac3521af12e4b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_b_g2_drawable.html#a8e9f1e5922e81e596d3ac3521af12e4b">image</a> (<a class="el" href="group__math.html#ga2e4fcb4037bc16967e23c20126d25396">UInt2</a> pos, const <a class="el" href="struct_sifteo_1_1_asset_image.html">AssetImage</a> &amp;image, unsigned frame=0)</td></tr>
<tr class="memdesc:a8e9f1e5922e81e596d3ac3521af12e4b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Draw a full <a class="el" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a> frame, with its top-left corner at the specified location.  <a href="#a8e9f1e5922e81e596d3ac3521af12e4b">More...</a><br/></td></tr>
<tr class="separator:a8e9f1e5922e81e596d3ac3521af12e4b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab90a83427057e1787d7c8f7d3ea7c43a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_b_g2_drawable.html#ab90a83427057e1787d7c8f7d3ea7c43a">image</a> (<a class="el" href="group__math.html#ga2e4fcb4037bc16967e23c20126d25396">UInt2</a> destXY, <a class="el" href="group__math.html#ga2e4fcb4037bc16967e23c20126d25396">UInt2</a> size, const <a class="el" href="struct_sifteo_1_1_asset_image.html">AssetImage</a> &amp;image, <a class="el" href="group__math.html#ga2e4fcb4037bc16967e23c20126d25396">UInt2</a> srcXY, unsigned frame=0)</td></tr>
<tr class="memdesc:ab90a83427057e1787d7c8f7d3ea7c43a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Draw part of an <a class="el" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a> frame, with its top-left corner at the specified location.  <a href="#ab90a83427057e1787d7c8f7d3ea7c43a">More...</a><br/></td></tr>
<tr class="separator:ab90a83427057e1787d7c8f7d3ea7c43a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad751ad7e861bbee7157834e81bd8a73d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_b_g2_drawable.html#ad751ad7e861bbee7157834e81bd8a73d">plot</a> (<a class="el" href="group__math.html#ga2e4fcb4037bc16967e23c20126d25396">UInt2</a> pos, uint16_t tileIndex)</td></tr>
<tr class="memdesc:ad751ad7e861bbee7157834e81bd8a73d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Plot a single tile, by absolute tile index, at location 'pos' in tile units.  <a href="#ad751ad7e861bbee7157834e81bd8a73d">More...</a><br/></td></tr>
<tr class="separator:ad751ad7e861bbee7157834e81bd8a73d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad1141ac18e19f20e1a1f54eef1bf0153"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_b_g2_drawable.html#ad1141ac18e19f20e1a1f54eef1bf0153">setBorder</a> (<a class="el" href="struct_sifteo_1_1_r_g_b565.html">RGB565</a> color)</td></tr>
<tr class="memdesc:ad1141ac18e19f20e1a1f54eef1bf0153"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the border color, given an arbitrary 16-bit <a class="el" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> color.  <a href="#ad1141ac18e19f20e1a1f54eef1bf0153">More...</a><br/></td></tr>
<tr class="separator:ad1141ac18e19f20e1a1f54eef1bf0153"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad036c532e33e6e2c998e955c0dbba08b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad036c532e33e6e2c998e955c0dbba08b"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_b_g2_drawable.html#ad036c532e33e6e2c998e955c0dbba08b">setMatrix</a> (const <a class="el" href="struct_sifteo_1_1_affine_matrix.html">AffineMatrix</a> &amp;m)</td></tr>
<tr class="memdesc:ad036c532e33e6e2c998e955c0dbba08b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the current affine transform matrix. <br/></td></tr>
<tr class="separator:ad036c532e33e6e2c998e955c0dbba08b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6feffa2e0941af0de499f9bb171afe95"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_b_g2_drawable.html#a6feffa2e0941af0de499f9bb171afe95">span</a> (<a class="el" href="group__math.html#ga2e4fcb4037bc16967e23c20126d25396">UInt2</a> pos, unsigned width, unsigned tileIndex)</td></tr>
<tr class="memdesc:a6feffa2e0941af0de499f9bb171afe95"><td class="mdescLeft">&#160;</td><td class="mdescRight">Plot a horizontal span of tiles, by absolue tile index, given the position of the leftmost tile and the number of tiles to plot.  <a href="#a6feffa2e0941af0de499f9bb171afe95">More...</a><br/></td></tr>
<tr class="separator:a6feffa2e0941af0de499f9bb171afe95"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aadca759b87113d1189d357f53c726013"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_b_g2_drawable.html#aadca759b87113d1189d357f53c726013">text</a> (<a class="el" href="group__math.html#ga4aa5e1c76d3adebd72a73a7051ad1fe0">Int2</a> topLeft, const <a class="el" href="struct_sifteo_1_1_asset_image.html">AssetImage</a> &amp;font, const char *str, char firstChar= ' ')</td></tr>
<tr class="memdesc:aadca759b87113d1189d357f53c726013"><td class="mdescLeft">&#160;</td><td class="mdescRight">Draw text, using an <a class="el" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a> as a fixed width font.  <a href="#aadca759b87113d1189d357f53c726013">More...</a><br/></td></tr>
<tr class="separator:aadca759b87113d1189d357f53c726013"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a57ccb253520fed5b21df56fbb345fb05"><td class="memItemLeft" align="right" valign="top">uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_b_g2_drawable.html#a57ccb253520fed5b21df56fbb345fb05">tileAddr</a> (<a class="el" href="group__math.html#ga2e4fcb4037bc16967e23c20126d25396">UInt2</a> pos)</td></tr>
<tr class="memdesc:a57ccb253520fed5b21df56fbb345fb05"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate the video buffer address of a particular tile.  <a href="#a57ccb253520fed5b21df56fbb345fb05">More...</a><br/></td></tr>
<tr class="separator:a57ccb253520fed5b21df56fbb345fb05"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7fb8b63d0967c2dec4d8face8a77d322"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7fb8b63d0967c2dec4d8face8a77d322"></a>
_SYSVideoBuffer &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_b_g2_drawable.html#a7fb8b63d0967c2dec4d8face8a77d322">videoBuffer</a> ()</td></tr>
<tr class="memdesc:a7fb8b63d0967c2dec4d8face8a77d322"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the <a class="el" href="struct_sifteo_1_1_video_buffer.html" title="A memory buffer which holds graphics data.">VideoBuffer</a> associated with this drawable. <br/></td></tr>
<tr class="separator:a7fb8b63d0967c2dec4d8face8a77d322"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a0b2a811a943befd81191b37d18a20bdb"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0b2a811a943befd81191b37d18a20bdb"></a>
static unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_b_g2_drawable.html#a0b2a811a943befd81191b37d18a20bdb">pixelHeight</a> ()</td></tr>
<tr class="memdesc:a0b2a811a943befd81191b37d18a20bdb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the height, in pixel, of this mode. <br/></td></tr>
<tr class="separator:a0b2a811a943befd81191b37d18a20bdb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4668fe654ee9304ef1ad007c74835828"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4668fe654ee9304ef1ad007c74835828"></a>
static <a class="el" href="group__math.html#ga2e4fcb4037bc16967e23c20126d25396">UInt2</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_b_g2_drawable.html#a4668fe654ee9304ef1ad007c74835828">pixelSize</a> ()</td></tr>
<tr class="memdesc:a4668fe654ee9304ef1ad007c74835828"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the size of this mode as a vector, in pixels. <br/></td></tr>
<tr class="separator:a4668fe654ee9304ef1ad007c74835828"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5792d755bbfc96e9c82423b940885c79"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5792d755bbfc96e9c82423b940885c79"></a>
static unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_b_g2_drawable.html#a5792d755bbfc96e9c82423b940885c79">pixelWidth</a> ()</td></tr>
<tr class="memdesc:a5792d755bbfc96e9c82423b940885c79"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the width, in pixels, of this mode. <br/></td></tr>
<tr class="separator:a5792d755bbfc96e9c82423b940885c79"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af17c092b857dbb04bea1be248bbda988"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af17c092b857dbb04bea1be248bbda988"></a>
static unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_b_g2_drawable.html#af17c092b857dbb04bea1be248bbda988">sizeInBytes</a> ()</td></tr>
<tr class="memdesc:af17c092b857dbb04bea1be248bbda988"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the size of this drawable's tile data, in bytes. <br/></td></tr>
<tr class="separator:af17c092b857dbb04bea1be248bbda988"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6e4dc734c35022e6581d8f1fa50f23b7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6e4dc734c35022e6581d8f1fa50f23b7"></a>
static unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_b_g2_drawable.html#a6e4dc734c35022e6581d8f1fa50f23b7">sizeInWords</a> ()</td></tr>
<tr class="memdesc:a6e4dc734c35022e6581d8f1fa50f23b7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the size of this drawable's tile data, in 16-bit words. <br/></td></tr>
<tr class="separator:a6e4dc734c35022e6581d8f1fa50f23b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a54d6f73dab3eddf8c74ec8b9b6945b55"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a54d6f73dab3eddf8c74ec8b9b6945b55"></a>
static unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_b_g2_drawable.html#a54d6f73dab3eddf8c74ec8b9b6945b55">tileHeight</a> ()</td></tr>
<tr class="memdesc:a54d6f73dab3eddf8c74ec8b9b6945b55"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the height, in tiles, of this mode. <br/></td></tr>
<tr class="separator:a54d6f73dab3eddf8c74ec8b9b6945b55"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac2c57141d252b8d8c518636d61b354be"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac2c57141d252b8d8c518636d61b354be"></a>
static <a class="el" href="group__math.html#ga2e4fcb4037bc16967e23c20126d25396">UInt2</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_b_g2_drawable.html#ac2c57141d252b8d8c518636d61b354be">tileSize</a> ()</td></tr>
<tr class="memdesc:ac2c57141d252b8d8c518636d61b354be"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the size of this mode as a vector, in tiles. <br/></td></tr>
<tr class="separator:ac2c57141d252b8d8c518636d61b354be"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a719f833bad10286b2af95e95eeb498b3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a719f833bad10286b2af95e95eeb498b3"></a>
static unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_b_g2_drawable.html#a719f833bad10286b2af95e95eeb498b3">tileWidth</a> ()</td></tr>
<tr class="memdesc:a719f833bad10286b2af95e95eeb498b3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the width, in tiles, of this mode. <br/></td></tr>
<tr class="separator:a719f833bad10286b2af95e95eeb498b3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A VRAM accessor for drawing graphics in the BG2 mode. </p>
<p>This is a special-purpose mode for doing scaling, rotation, and other effects using an affine transform matrix.</p>
<p>Conceptually, this mode is a 256x256-pixel canvas, repeating forever in both axes, in which the top-left quadrant is a 16x16-tile drawable, and the other three quadrants are painted with a solid "border" color.</p>
<p>This arrangement allows you to treat the 16x16 area as "centered" on the screen, with the border color poking through when that image is scaled down or rotated.</p>
<p>Note that the border color is not part of the <a class="el" href="struct_sifteo_1_1_colormap.html" title="An accessor for the colormap, with up to 16 colors.">Colormap</a>, it is a separate piece of state that can be set through the <a class="el" href="struct_sifteo_1_1_b_g2_drawable.html" title="A VRAM accessor for drawing graphics in the BG2 mode.">BG2Drawable</a>. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="ac3f2bafb7d3461525daec13349a6808d"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void Sifteo::BG2Drawable::erase </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>index</em> = <code>0</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Erase mode-specific VRAM, filling the BG2 buffer with the specified absolute tile index value. </p>
<p>Does not modify the affine transform or the border color. </p>

</div>
</div>
<a class="anchor" id="a8b5b5f6933bf76a1d93dd7f4ac2c2cee"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void Sifteo::BG2Drawable::fill </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__math.html#ga2e4fcb4037bc16967e23c20126d25396">UInt2</a>&#160;</td>
          <td class="paramname"><em>topLeft</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__math.html#ga2e4fcb4037bc16967e23c20126d25396">UInt2</a>&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&#160;</td>
          <td class="paramname"><em>tileIndex</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Fill a rectangle of identical tiles, specified as a top-left corner location and a size. </p>
<p>All coordinates must be in range. This function performs no clipping. </p>

</div>
</div>
<a class="anchor" id="a8e9f1e5922e81e596d3ac3521af12e4b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void Sifteo::BG2Drawable::image </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__math.html#ga2e4fcb4037bc16967e23c20126d25396">UInt2</a>&#160;</td>
          <td class="paramname"><em>pos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="struct_sifteo_1_1_asset_image.html">AssetImage</a> &amp;&#160;</td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&#160;</td>
          <td class="paramname"><em>frame</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Draw a full <a class="el" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a> frame, with its top-left corner at the specified location. </p>
<p>Locations are specified in tile units, relative to the top-left of the 18x18 grid.</p>
<p>All coordinates must be in range. This function performs no clipping. </p>

</div>
</div>
<a class="anchor" id="ab90a83427057e1787d7c8f7d3ea7c43a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void Sifteo::BG2Drawable::image </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__math.html#ga2e4fcb4037bc16967e23c20126d25396">UInt2</a>&#160;</td>
          <td class="paramname"><em>destXY</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__math.html#ga2e4fcb4037bc16967e23c20126d25396">UInt2</a>&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="struct_sifteo_1_1_asset_image.html">AssetImage</a> &amp;&#160;</td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__math.html#ga2e4fcb4037bc16967e23c20126d25396">UInt2</a>&#160;</td>
          <td class="paramname"><em>srcXY</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&#160;</td>
          <td class="paramname"><em>frame</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Draw part of an <a class="el" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a> frame, with its top-left corner at the specified location. </p>
<p>Locations are specified in tile units, relative to the top-left of the 18x18 grid.</p>
<p>All coordinates must be in range. This function performs no clipping. </p>

</div>
</div>
<a class="anchor" id="ad751ad7e861bbee7157834e81bd8a73d"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void Sifteo::BG2Drawable::plot </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__math.html#ga2e4fcb4037bc16967e23c20126d25396">UInt2</a>&#160;</td>
          <td class="paramname"><em>pos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>tileIndex</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Plot a single tile, by absolute tile index, at location 'pos' in tile units. </p>
<p>All coordinates must be in range. This function performs no clipping. </p>

</div>
</div>
<a class="anchor" id="ad1141ac18e19f20e1a1f54eef1bf0153"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void Sifteo::BG2Drawable::setBorder </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_sifteo_1_1_r_g_b565.html">RGB565</a>&#160;</td>
          <td class="paramname"><em>color</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Set the border color, given an arbitrary 16-bit <a class="el" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> color. </p>
<p>This color is displayed 'outside' the 16x16-tile drawable region, in the other three quadrants of the virtual 256x256-pixel plane. </p>

</div>
</div>
<a class="anchor" id="a6feffa2e0941af0de499f9bb171afe95"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void Sifteo::BG2Drawable::span </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__math.html#ga2e4fcb4037bc16967e23c20126d25396">UInt2</a>&#160;</td>
          <td class="paramname"><em>pos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&#160;</td>
          <td class="paramname"><em>tileIndex</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Plot a horizontal span of tiles, by absolue tile index, given the position of the leftmost tile and the number of tiles to plot. </p>
<p>All coordinates must be in range. This function performs no clipping. </p>

</div>
</div>
<a class="anchor" id="aadca759b87113d1189d357f53c726013"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void Sifteo::BG2Drawable::text </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__math.html#ga4aa5e1c76d3adebd72a73a7051ad1fe0">Int2</a>&#160;</td>
          <td class="paramname"><em>topLeft</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="struct_sifteo_1_1_asset_image.html">AssetImage</a> &amp;&#160;</td>
          <td class="paramname"><em>font</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>str</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>firstChar</em> = <code>'&#160;'</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Draw text, using an <a class="el" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a> as a fixed width font. </p>
<p>Each character is represented by a consecutive 'frame' in the image. Characters not present in the font will be skipped. </p>

</div>
</div>
<a class="anchor" id="a57ccb253520fed5b21df56fbb345fb05"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint16_t Sifteo::BG2Drawable::tileAddr </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__math.html#ga2e4fcb4037bc16967e23c20126d25396">UInt2</a>&#160;</td>
          <td class="paramname"><em>pos</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Calculate the video buffer address of a particular tile. </p>
<p>All coordinates must be in range. This function performs no clipping. </p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="bg2_8h_source.html">bg2.h</a></li>
</ul>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.3.1-->
<!-- start footer part -->
    <hr class="footer"/>
    <address class="footer">
        <p><a href="http://sifteo.com">Sifteo</a> SDK v1.0.0 <small>(see <a href="https://developers.sifteo.com/sifteosdk">all versions</a>)</small></p>
        <p>Last updated Wed Mar 27 2013, by <a href="http://www.stack.nl/~dimitri/doxygen">Doxygen</a></p>
    </address>
</body>
</html>
